using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BKMusic : MonoBehaviour
{
    // Start is called before the first frame update
    private static BKMusic instance;
    public static BKMusic Instance=>instance;

    private AudioSource audiosource;

    private void Awake()
    {
        instance = this;
        audiosource = GetComponent<AudioSource>();
        SetMusicIsOn(GameDataMgr.Instance.musicData.MusicIsOn);
        SetMusicValue(GameDataMgr.Instance.musicData.MusicValue);
    }
   public void SetMusicIsOn(bool value)
    {
        audiosource.mute = !value;
    }
    public void SetMusicValue(float value)
    {
        audiosource.volume = value;
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}
